<template>

    <list>
        <cell v-for="item in items" @click="itemClick(item.url)">
            <div class="div">
                <text class="tv_title">{{item.title}}</text>
                <image class="iv_image" :src="item.thumbnail_pic_s"></image>
            </div>
        </cell>

    </list>

</template>

<script>

    var netModule = weex.requireModule('netmodule')
    var modal = weex.requireModule('modal')
    var jump = weex.requireModule('jump')

    export default{
        data(){
            return {
                items: [],
                url: 'http://v.juhe.cn/toutiao/index?type=top&key=d78b502268f7456b79fbe7228cecdd46'
            }
        },
        methods: {
            itemClick(url){
                jump.jump(url)
            },
            getNews(url){
                var self = this
                netModule.getResult(url,
                    function (res) {
                        self.items = res.data.result.data;
                    })
            }
        },
        created(){
            var self = this;
            self.getNews(self.url)
        }
    }

</script>

<style>
    .tv_title {
        width: 600px;
        font-size: 30px;
        height: 150px;
        padding: 10px;
        text-align: left;
    }

    .iv_image {
        width: 150px;
        height: 150px;
    }

    .div {
        lines: 1;
        flex-direction: row;
        justify-content: space-between;
    }
</style>